// Step1: Promise 由 new 生成，实例带 then 方法
// Step2: Promise 内部立即执行，有俩函数 onResolve & onReject，同时有三种状态

const PENDING = 'pending';
const RESOLVED = 'fulfilled';
const REJECTED = 'rejected';

class MyPromise {
  constructor(excutor) {
    this.value = undefined;
    this.status = PENDING;

    onResolve = () => {};

    onReject = () => {};

    try {
      excutor(onResolve, onReject);
    } catch (e) {
      onReject(e);
    }
  }

  then() {}
}
